package com.bm.web.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bm.dao.ImgDao;
import com.bm.dao.impl.ImgDaoImpl;
import com.bm.entity.Img;
import com.bm.service.ImgService;
import com.bm.service.impl.ImgServiceImpl;

/**
 * Servlet implementation class XlServlet
 */
@WebServlet("/XlServlet")
public class XlServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public XlServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		ImgService is = new ImgServiceImpl();
		String xlName = request.getParameter("xilie");
		List<Img> imglist = is.qureyAllImgXl(xlName);
		
		request.setAttribute("ImgName", xlName+"系列：");
		request.setAttribute("imglist", imglist);
//		request.setAttribute("ImgName", ImgName);
		//request.setAttribute("url", "bakg.jsp");
		request.getRequestDispatcher("homeOne.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
